<html><head><title>ButtonImageGadget</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">ButtonImageGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>ButtonImageGadget</b></font>(#Gadget, x, y, Width, Height, ImageID [, Flags])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Create a button gadget with an image in the current GadgetList. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
The position and dimensions of the new gadget. 

</td></tr>
<tr><td><i>ImageID</i></td>
<td> 
The image for the gadget. Use the <a href="../image/imageid.html">ImageID()</a> function to get this ID from an image. 
This parameter can be zero to create a button without an image. The <a href="setgadgetattribute.html">SetGadgetAttribute()</a> 
function can be used to change the image later. 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
This parameter can be <font color="#924B72">#PB_Button_Toggle</font> to create a toggle-button (one which has an on/off state). 
A push-button is created by default. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

</blockquote><p><b>Remarks</b></p><blockquote>

A 'mini help' can be added to this gadget using <a href="gadgettooltip.html">GadgetToolTip()</a>. 
<br>
<br>
The following functions can be used to control the gadget: 
<br>
<br>
- <a href="getgadgetstate.html">GetGadgetState()</a> can be used to get the toggle state of the gadget. 
<br>
- <a href="setgadgetstate.html">SetGadgetState()</a> can be used to set the toggle state of the gadget. 
<br>
- <a href="getgadgetattribute.html">GetGadgetAttribute()</a> with the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Button_Image</font>       : Get the displayed image.
  <font color="#924B72">#PB_Button_PressedImage</font>: Get the image displayed when the button is pressed.
</font></pre>
- <a href="setgadgetattribute.html">SetGadgetAttribute()</a> with the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Button_Image</font>       : Set the displayed image.
  <font color="#924B72">#PB_Button_PressedImage</font>: Set the image displayed when the button is pressed.
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 120, 100, &quot;ButtonImage&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">LoadImage</font>(0, &quot;map.bmp&quot;)    <font color="#3A3966">; change 2nd parameter to the path/filename of your image</font>
<font color="#3A3966">      ButtonImageGadget</font>(0, 10, 10, 100, 83,<font color="#3A3966"> ImageID</font>(0))
    <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Repeat</font></b>
    <b><font color="#3A3966">Until</font></b> <font color="#3A3966">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/buttonimagegadget.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetstate.html">GetGadgetState()</a>, <a href="setgadgetstate.html">SetGadgetState()</a>, <a href="getgadgetattribute.html">GetGadgetAttribute()</a>, <a href="setgadgetattribute.html">SetGadgetAttribute()</a>, <a href="buttongadget.html">ButtonGadget()</a>, <a href="../image/imageid.html">ImageID()</a>, <a href="../window/eventgadget.html">EventGadget()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=buttongadget.html>ButtonGadget()</a> - <a href="index.html">Gadget Index</a> - <a href="calendargadget.html">CalendarGadget()</a> -><br><br>

</body></html>